This directory contains the test suite for the SonarQube deployment project. The testing approach focuses on essential functionality to ensure core features are working correctly.
conftest.py: Common test fixtures and configurationsintegration/: Integration tests for SonarQube deploymentrun_tests.py: Main test runner scriptsyntax_check.yml: Ansible syntax checking playbookThe run_tests.py script provides a simple way to execute all tests:
# For Vagrant development environment
./tests/run_tests.py --vagrant
# For production environment
./tests/run_tests.py --host <server-ip>
You can also run individual test components:
# Lint checks
ansible-lint
# Syntax check
ansible-playbook tests/syntax_check.yml
# Integration tests only
pytest -v tests/integration/
Required Python packages:
Install dependencies using:
pip install -r requirements.txt
The test suite can be configured through command-line options:
--host: Target host for testing (default: localhost)--port: SonarQube port (default: 9000)--vagrant: Run against Vagrant development environmentThe test runner will provide clear pass/fail indicators:
Full test output will be displayed for any failures to aid in troubleshooting.